package galaxies.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/*
 * Defines number of tiles that a galaxy should have for a given size.
 * 
 * Values read in via external XML file.
 */

public class GalaxySize {
	
	private HashMap<String, Integer> galaxySizes = new HashMap<String, Integer>();
	private ArrayList<String> entries = new ArrayList<String>();
	
	public ArrayList<String> getEntries() {
		return this.entries;
	}
	
	public void addGalaxySize(String size, int numTiles) {
		galaxySizes.put(size, numTiles);
		entries.add(size);
	}
	
	public int getGalaxySize(String ref) {
		return galaxySizes.get(ref);
	}
	
	public HashMap<String, Integer> getGalaxySizes() {
		return this.galaxySizes;
	}
	
	public void setGalaxySizes(HashMap<String, Integer> galSizes) {
		this.galaxySizes.clear();
		this.galaxySizes.putAll(galSizes);
		
		for (Map.Entry<String, Integer> entry : galaxySizes.entrySet()) {
			entries.add(entry.getKey());
		}
	}

}
